/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Engine2D.renderer;

/**
 *
 * @author Garys
 */
public class LineStripRenderer implements LineStripRendererInterface {
    
    private GLRenderer renderer = Renderer.get();

    /**
     * 
     */
    @Override
    public void start() {
        renderer.glBegin(GLRenderer.GL_LINE_STRIP);
    }

    /**
     * 
     */
    @Override
    public void end() {
        renderer.glEnd();
    }

    /**
     * 
     * @param x
     * @param y
     */
    @Override
    public void vertex(float x, float y) {
        renderer.glVertex2f(x, y);
    }

    /**
     * 
     * @param red
     * @param green
     * @param blue
     * @param alpha
     */
    @Override
    public void setColour(float red, float green, float blue, float alpha) {
        renderer.glClearColor(red, green, blue, alpha);
    }

    /**
     * 
     * @param width
     */
    @Override
    public void setWidth(float width) {
        renderer.glLineWidth(width);
    }

    /**
     * 
     * @param antialias
     */
    @Override
    public void setAntiAlias(boolean antialias) {
        if(antialias){
            renderer.glEnable(GLRenderer.GL_LINE_SMOOTH);
        } else {
            renderer.glDisable(GLRenderer.GL_LINE_SMOOTH);
        }
    }

    /**
     * 
     * @param caps
     */
    @Override
    public void setLineCaps(boolean caps) {
    }
    
}
